<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1"
	import="database.ReceptDTO, database.MySQLReceptDAO, java.util.ArrayList"%>

<%
	request.setAttribute("title", "Create product batch");
%>

<%
	MySQLReceptDAO receptDAO;
	ArrayList<ReceptDTO> receptIdList = new ArrayList<ReceptDTO>();
	receptDAO = new MySQLReceptDAO();
	receptIdList = receptDAO.getReceptList();
%>

<%@include file="/WEB-INF/html/header.jsp"%>

<h1>Make new product batch:</h1>
<br>

<% String message = (String) request.getAttribute("message"); %>
<% if (message.equals(" "))
	out.println("<br>");
else
	out.println(message);
%>

<form method="post" action="<%out.print(request.getContextPath());%>/Productbatch">

	<select name="receptId">

		<%
			for (int i = 0; i < receptIdList.size(); i++) {
				out.print("<option value=\""
						+ receptIdList.get(i).getReceptId() + "\">");
				out.print(receptIdList.get(i).getReceptId() + " "
						+ receptIdList.get(i).getReceptNavn());
				out.print("</option>");
			}
		%>

	</select> <input type="submit" name="createNewBatch" value="Create">
</form>

<%@include file="/WEB-INF/html/footer.jsp"%>